#ifndef Brocko_H
#define Brocko_H

#include "Win.h"
#include "Player.h"
#include "SoundPlayer.h"
#include "InputHandler.h"
#include "World.h"
#include "Apple.h"
#include <Windows.h>
#include <sstream>
#include "Highscore.h"
#include "ReadHighscores.h"
#include "WritingScore.h"
#include <mmsystem.h>


#pragma comment(lib, "winmm.lib")

using namespace std;



class CBrocko : public CWin
{

private:
	int width;
	int height;
	bool playing;
	bool showHighscores;
	RECT rect;
	HDC bufDC;
	HBITMAP bufBMP;
	HANDLE hImage;
	HANDLE hLifeImage;
	HANDLE* hMenu;
	HANDLE* hSplashMenu;
	HANDLE hScoreboard;
	CPlayer player;
	World world;
	int frames;
	CApple apple;
	int diff_ms(long t1, long t2);
	int msqueue;
	SYSTEMTIME lastTime;
	long lastMsTime;
	float startTime;
	float curTime;
	int playingTime;
	int menuItem;
	int splashMenuItem;
	HWND * handle;
	bool upAlreadyPressed;
	bool downAlreadyPressed;
	void handleMenu();
	void handleSplashMenu();

public:
	CBrocko();
	~CBrocko();

	LRESULT MsgProc(HWND, UINT, WPARAM, LPARAM);

	void GameInit();
	void GameLoop();
	void GameEnd();
	void Draw();
	string getFrames();
	string getPlayingTime();

};

#endif
